<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="/template/StakeholderTemplate.xhtml">

    <ui:define name="contentInsert">
          <h3>Modify Area in Show</h3>
                <h:form id="showUpdateForm">
                    <p:ajaxStatus style="width:16px;height:16px;">
                        <f:facet name="start">
                            <h:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" />
                        </f:facet>
                        <f:facet name="complete">
                            <h:outputText value="" />
                        </f:facet>
                    </p:ajaxStatus>
                    <p:messages />
                    
                            <p:dataTable value="#{stakeholderPerformanceMB.getAllAreas()}" var="areas">
                                
                                <p:column>
                                    <f:facet name="header">Area ID</f:facet>
                                    <h:outputText id="areaId" value="#{areas.id}" />
                                </p:column>

                                <p:column>
                                    <f:facet name="header">Area Name</f:facet>         
                                    <h:outputText id="areaName" value="#{areas.areaName}" />
                                </p:column>
                                
                                <p:column>
                                    <f:facet name="header">Cost</f:facet>
                                    <h:outputText id="cost" value="#{areas.cost}" />
                                </p:column>
                                
                                <p:column>
                                    <f:facet name="header">Capacity</f:facet>
                                    <h:outputText id="capacity" value="#{areas.capacity}" />
                                </p:column>
                                
                                <p:column>
                                    <f:facet name="header">Action</f:facet>
                                    <h:commandButton  value="Modify" 
                                                    onclick="if (!confirm('Are you sure you want to modify area ##{areas.id}(#{areas.areaName})?')) return false"
                                                    action="modifyselectedarea.xhtml?faces-redirect=true">
                                        <f:setPropertyActionListener target="#{stakeholderPerformanceMB.areaId}" value="#{areas.id}"/>
                                        <f:setPropertyActionListener target="#{stakeholderPerformanceMB.areaName}" value="#{areas.areaName}"/>
                                        <f:setPropertyActionListener target="#{stakeholderPerformanceMB.cost}" value="#{areas.cost}"/>
                                    </h:commandButton>
                                </p:column>
                            </p:dataTable> 

                </h:form>
                 </ui:define>
</ui:composition>

